package com.example.demo.vo

import com.example.demo.dbmodels.VJzrInpatientFeeRecord
import io.swagger.annotations.ApiModelProperty
import java.math.BigDecimal
import java.time.LocalDateTime

class FeeVo {
    @ApiModelProperty("PATIENT_ID")
    var PATIENT_ID: String? = null

    @ApiModelProperty("SERIES")
    var SERIES: BigDecimal? = null

    @ApiModelProperty("ADMISSION_ID")
    var ADMISSION_ID: String? = null

    @ApiModelProperty("FEE_TYPE_CODE")
    var FEE_TYPE_CODE: String? = null

    @ApiModelProperty("FEE_TYPE")
    var FEE_TYPE: String? = null

    @ApiModelProperty("FEE_CODE")
    var FEE_CODE: String? = null

    @ApiModelProperty("FEE_NAME")
    var FEE_NAME: String? = null

    @ApiModelProperty("FEE_DATE")
    var FEE_DATE: LocalDateTime? = null

    @ApiModelProperty("FEE_VALUE")
    var FEE_VALUE: BigDecimal? = null

    @ApiModelProperty("INV_NO")
    var INV_NO: String? = null

    @ApiModelProperty("FEE_DETAIL")
    var FEE_DETAIL: String? = null

    @ApiModelProperty("BILL_QTY")
    var BILL_QTY: BigDecimal? = null

    @ApiModelProperty("UNIT")
    var UNIT: String? = null

    @ApiModelProperty("UNIT_PRICE")
    var UNIT_PRICE: BigDecimal? = null

    @ApiModelProperty("DISC_PRICE")
    var DISC_PRICE: BigDecimal? = null

    @ApiModelProperty("INS_PRICE")
    var INS_PRICE: BigDecimal? = null

    @ApiModelProperty("PAT_PRICE")
    var PAT_PRICE: BigDecimal? = null

    @ApiModelProperty("DISC_AMOUNT")
    var DISC_AMOUNT: BigDecimal? = null

    @ApiModelProperty("PAYOR_AMOUNT")
    var PAYOR_AMOUNT: BigDecimal? = null

    @ApiModelProperty("PAT_AMOUNT")
    var PAT_AMOUNT: BigDecimal? = null

    @ApiModelProperty("TOTAL_AMOUNT")
    var TOTAL_AMOUNT: BigDecimal? = null

    @ApiModelProperty("STATUS")
    var STATUS: BigDecimal? = null

    @ApiModelProperty("REMARK")
    var REMARK: String? = null

    fun getVo(table: VJzrInpatientFeeRecord): FeeVo {
        table.let {
            val data = FeeVo()
            data.ADMISSION_ID = it.ADMISSION_ID
            data.BILL_QTY = it.BILL_QTY
            data.DISC_AMOUNT = it.DISC_AMOUNT
            data.DISC_PRICE = it.DISC_PRICE
            data.FEE_CODE = it.FEE_CODE
            data.FEE_DATE = it.FEE_DATE
            data.FEE_DETAIL = it.FEE_DETAIL
            data.FEE_NAME = it.FEE_NAME
            data.FEE_TYPE = it.FEE_TYPE
            data.FEE_TYPE_CODE = it.FEE_TYPE_CODE
            data.FEE_VALUE = it.FEE_VALUE
            data.INS_PRICE = it.INS_PRICE
            data.INV_NO = it.INV_NO
            data.PATIENT_ID = it.PATIENT_ID
            data.PAT_AMOUNT = it.PAT_AMOUNT
            data.PAT_PRICE = it.PAT_PRICE
            data.PAYOR_AMOUNT = it.PAYOR_AMOUNT
            data.REMARK = it.REMARK
            data.SERIES = it.SERIES
            data.STATUS = it.STATUS
            data.TOTAL_AMOUNT = it.TOTAL_AMOUNT
            data.UNIT = it.UNIT
            data.UNIT_PRICE = it.UNIT_PRICE
            return data
        }
    }

    fun getListVo(table:List<VJzrInpatientFeeRecord>):List<FeeVo> {
        table.let {
            val feeVoList = mutableListOf<FeeVo>()
            it.forEach {
                val data = FeeVo()
                data.ADMISSION_ID = it.ADMISSION_ID
                data.BILL_QTY = it.BILL_QTY
                data.DISC_AMOUNT = it.DISC_AMOUNT
                data.DISC_PRICE = it.DISC_PRICE
                data.FEE_CODE = it.FEE_CODE
                data.FEE_DATE = it.FEE_DATE
                data.FEE_DETAIL = it.FEE_DETAIL
                data.FEE_NAME = it.FEE_NAME
                data.FEE_TYPE = it.FEE_TYPE
                data.FEE_TYPE_CODE = it.FEE_TYPE_CODE
                data.FEE_VALUE = it.FEE_VALUE
                data.INS_PRICE = it.INS_PRICE
                data.INV_NO = it.INV_NO
                data.PATIENT_ID = it.PATIENT_ID
                data.PAT_AMOUNT = it.PAT_AMOUNT
                data.PAT_PRICE = it.PAT_PRICE
                data.PAYOR_AMOUNT = it.PAYOR_AMOUNT
                data.REMARK = it.REMARK
                data.SERIES = it.SERIES
                data.STATUS = it.STATUS
                data.TOTAL_AMOUNT = it.TOTAL_AMOUNT
                data.UNIT = it.UNIT
                data.UNIT_PRICE = it.UNIT_PRICE
                feeVoList.add(data)
            }
            return  feeVoList
        }
    }

}